def deep_copy(obj, memo=None):
    """对象的深拷贝"""

    # 获取对象在内存中的地址
    obj_address = id(obj)

    if obj_address in memo:
        return memo[obj_address]

    memo[obj_address] = obj

    # 如果是要拷贝列表的话
    if isinstance(obj, list):

        copy_list = []
        copy_list.extend(deep_copy(item, memo) for item in obj)
        memo[id(copy_list)] = copy_list
        return copy_list

    # 如果obj字典是要拷贝字典
    elif isinstance(obj, dict):
        # obj ={"name":"jackie","age": 19, (1,2):(1,2,3,4,5) }
        new_dict = {}
        for k, v in obj.items():

            # new_dict[k] = deep_copy(v, memo)
            new_dict[deep_copy(k, memo)] = deep_copy(v, memo)

        memo[id(new_dict)] = new_dict

        return new_dict

    else:
        return obj
